<template>
  <div class="container">
    <div class="mainArea">
      <div class="td">天渡配送</div>
      <div class="buttonArea">
        <div class="allocation back" @click="logout">退出登录</div>
      </div>
    </div>
  </div>
</template>

<script>
import card from "@/components/card";
import store from "@/utils/factory.js";
import { logout } from "@/http";

export default {
  data() {
    return {
      list: [],
      source: {
        report: "留言",
        400: "热线",
        add: "客户导入"
      },
      status: {
        undo: "未处理",
        doing: "正在沟通",
        recycle: "回收"
      },
      assign: false
    };
  },

  components: {
    card
  },

  methods: {
    initData() {
      this.list = [];
    },
    logout() {
      if (!this.userInfo) {
        mpvue.navigateTo({
          url: "../login/main"
        });
        return false;
      }
      logout().then(res => {
        this.userInfo = "";
        store.clear();
        mpvue.showModal({
          title: "提示",
          showCancel: false,
          content: "退出登录成功",
          success: function(res) {
            if (res.confirm) {
              store.clear();
              mpvue.navigateTo({
                url: "../login/main"
              });
            }
          }
        });
      });
    }
  },
  created() {},
  onLoad() {},
  onShow() {}
};
</script>

<style scoped>
.allocation {
  color: #222222 !important;
  background: #ffc300;
  text-align: center;
  line-height: 88rpx;
  width: 320px;
  border-radius: 80rpx;
}
.buttonArea {
  display: flex;
  color: #fff;
  border-radius: 40rpx;
  justify-content: center;
  position: fixed;
  bottom: 40rpx;
  left: 0;
  right: 0;
}
.td {
  background: #ffc300;
  width: 160rpx;
  height: 160rpx;
  border-radius: 160rpx;
  line-height: 160rpx;
  text-align: center;
  font-weight: bold;
  font-size: 28rpx;
  margin: 30rpx auto;
}
</style>
